package org.starsource.forum.client.domain;


import java.sql.Timestamp;

import org.starsource.forum.client.util.Assertion;
import com.google.gwt.user.client.rpc.IsSerializable;

public class LoginFailObject implements IsSerializable {
	
	private int id;

	private String account;

	private String ip;

	private Timestamp timestamp;
	
	public LoginFailObject() {
		
	}
	
	public LoginFailObject(String account, String ip, Timestamp timestamp) {
		this.account = account;
		this.ip = ip;
		this.timestamp = timestamp;
	}
	
	public LoginFailObject(int id, String account, String ip, Timestamp timestamp) {
		this.id = id;
		this.account = account;
		this.ip = ip;
		this.timestamp = timestamp;
	}
	
	public boolean equals(Object obj) {
		try {
			LoginFailObject object = (LoginFailObject)obj;
			
			if (this.id != object.id) return false;
			
			if (!Assertion.isEqual(this.account, object.account)) return false;

			if (!Assertion.isEqual(this.ip, object.ip)) return false;
			
			if (!Assertion.isEqual(this.timestamp, object.timestamp)) return false;
			
			return true;
		} catch (Exception e) {
			return false;
		}
	}
	
	public String getAccount() {
		return this.account;
	}
	
	public void setAccount(String account) {
		this.account = account;
	}
	
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public Timestamp getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Timestamp timestamp) {
		this.timestamp = timestamp;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

}
